package net.peelmeagrape.hibernate.collections;

import net.peelmeagrape.hibernate.xmlgen.DefaultFromGenericType;
import net.peelmeagrape.hibernate.xmlgen.XmlAttribute;
import net.peelmeagrape.hibernate.xmlgen.XmlElement;
import net.peelmeagrape.hibernate.Column;

import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @deprecated I think you can always use {@link SimpleMapKey} or {@link ListIndex} instead.
 */
@Retention(RUNTIME)
@XmlElement(name="index")
public @interface Index
{
    Column[] columnMapping() default {};

    @XmlAttribute String column() default "";
    @DefaultFromGenericType(0) @XmlAttribute String[] type() default {};
    @XmlAttribute int length() default 255;
}
